let a: any;
// any可以赋值为任何类型
a = 123;
a = true;
a = [1];
a = { name: "jack" };
// any可以使用任何类型的方法
a.call();
a.map();
a.xxx();

// 类型自动推论
const person = {
  name: "jack",
  age: 18,
};
person.name = a;

let b: unknown;
// unknown可以赋值为任何类型
b = 123;
b = true;
b = [1];
b = { name: "jack" };
// unknown类型在使用时需要使用类型断言
person.name = b as string;

(b as Array<number>).map(() => {
  return 11;
});

// const btn = document.querySelector(".btn");
// (btn as HTMLButtonElement).onclick = function () {};

const btn = document.querySelector(".btn")!;
btn.addEventListener("click", function () {});
